{% extends "base.html" %}

{% block title %}{{ block.super }} &bull; Result {{ result.id }} Detail{% endblock %}

{% block content %}

<h2>Result {{ result.id }} Detail</h2>

<dl>
    <dt>id</dt><dd>{{ result.id }}</dd>
    <dt>type</dt><dd>{{ result.type }}</dd>
    <dt>test</dt><dd>
        <a href="{{ result.test.get_absolute_url }}">{{ result.test.file }}</a>
    </dd>
    <dt>test version</dt><dd>{{ result.test_version }}</dd>
    <dt>ua</dt><dd>
        <a href="{{ result.ua.get_absolute_url }}">{{ result.ua }}</a>
    </dd>
    <dt>date</dt><dd>{{ result.date }}</dd>
    <dt>duration</dt><dd>{{ result.duration }}</dd>
    <dt>session</dt><dd>
        <a href="{% url result-list-bysession session=result.session,page=1 %}">{{ result.session }}</a>
    </dd>
    <dt>succeeded</dt><dd>{{ result.succeeded }}</dd>
    <dt>status</dt><dd>{{ result.status }}</dd>

    {% ifequal result.type "mochitestresult" %}
    <h4>Mochitest result detail</h4>
    <dt>pass_count</dt><dd>{{ result.pass_count }}</dd>
    <dt>fail_count</dt><dd>{{ result.fail_count }}</dd>
    {# XXX temporary #}
    <dt>todo_count</dt><dd>{{ result.todo_count }}</dd>

    log:
    <pre class="code">{{ result.log }}</pre>
    {% endifequal %}

    {% ifequal result.type "layouttestresult" %}
      {% ifnotequal result.log None %}
        <h4>Layouttest result detail</h4>

        expected:
        <pre class="code">{{ result.test.expected_content }}</pre>

        actual:
        <pre class="code">{{ result.log }}</pre>

        diff:
        <pre class="code">{{ result.diff }}</pre>
      {% endifnotequal %}

    {% endifequal %}

    {% ifequal result.type "reftestresult" %}
    <h4>Reftest result detail</h4>
    <dt>pixel_diff</dt><dd>{{ result.pixel_diff }}</dd>
    <!-- <dt>saved_path</dt><dd>{{ result.saved_path }}</dd>  -->
    {% if result.saved_path %}
        <dt>img1</dt><dd><img src="{{ REFTEST_RESULTS_URL }}/{{ result.saved_path }}/img1.png"
                 class="reftestimg"></dd>
        <dt>img2</dt><dd><img src="{{ REFTEST_RESULTS_URL }}/{{ result.saved_path }}/img2.png"
                 class="reftestimg"></dd>
        <dt>diff</dt><dd><img src="{{ REFTEST_RESULTS_URL }}/{{ result.saved_path }}/imgdiff.png"
                 class="reftestimg"></dd>
    {% endif %}
    {% endifequal %}
</dl>

{% if perms.browsertests.delete_result %}
<form action="delete/" method="post">
    <input type="submit" value="Delete this result">
</form>
{% endif %}

{% endblock %}
